package com.base.self.controller;

import com.base.log.LoginAn;
import com.base.result.ResponseResult;
import com.base.self.dto.selfApplyRefund.SelfApplyRefundWebListDTO;
import com.base.self.dto.selfApplyRefund.SelfApplyRefundWebNoDTO;
import com.base.self.dto.selfApplyRefund.SelfApplyRefundWebOkDTO;
import com.base.self.service.ISelfApplyRefundService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * 退款申请
 *
 * @author XiFYuW
 * @since 2020-12-20
 */
@RestController
@RequestMapping("/admin/selfApplyRefund")
public class SelfApplyRefundController {

    private final ISelfApplyRefundService iSelfApplyRefundService;

    public SelfApplyRefundController(ISelfApplyRefundService iSelfApplyRefundService) {
        this.iSelfApplyRefundService = iSelfApplyRefundService;
    }

    @GetMapping(value = "/selfApplyRefundIndex")
    @LoginAn
    public ModelAndView selfApplyRefundIndex() {
        return new ModelAndView("self/index_self_apply_refund");
    }

    @PostMapping(value = "/selfApplyRefundWebList")
    @LoginAn(isRe = true)
    public ResponseResult selfApplyRefundWebList(@Validated final SelfApplyRefundWebListDTO selfApplyRefundWebListDTO) {
        return iSelfApplyRefundService.selfApplyRefundWebList(selfApplyRefundWebListDTO);
    }

    @PostMapping(value = "/selfApplyRefundWebOk")
    @LoginAn(isRe = true)
    public ResponseResult selfApplyRefundWebOk(@Validated final SelfApplyRefundWebOkDTO selfApplyRefundWebOkDTO) {
        return iSelfApplyRefundService.selfApplyRefundWebOk(selfApplyRefundWebOkDTO);
    }

    @PostMapping(value = "/selfApplyRefundWebNo")
    @LoginAn(isRe = true)
    public ResponseResult selfApplyRefundWebNo(@Validated final SelfApplyRefundWebNoDTO selfApplyRefundWebNoDTO) {
        return iSelfApplyRefundService.selfApplyRefundWebNo(selfApplyRefundWebNoDTO);
    }
}

